home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / gtkmm-2.4 / proc / m4 / convert_gtk.m4 < prev    next >
M4 Source File  |  2006-04-20  |  26KB  |  512 lines

  1. dnl $Id: convert_gtk.m4,v 1.31 2005/08/17 21:22:39 murrayc Exp $
  2.  
  3. include(convert_glib.m4)
  4.  
  5. #
  6. # Table of widgets
  7. #
  8.  
  9. _EQUAL(gboolean,int)
  10. _EQUAL(gint,int)
  11. _EQUAL(gint*,int*)
  12. _EQUAL(gint&,int&)
  13. _EQUAL(guint,unsigned int)
  14. _EQUAL(guint*,unsigned int*)
  15. _EQUAL(guint&,unsigned int&)
  16. _EQUAL(gdouble,double)
  17. _EQUAL(gdouble*,double*)
  18. _EQUAL(gfloat, float)
  19. _EQUAL(float*,gfloat[])
  20.  
  21. _EQUAL(GdkAtom,Gdk::Atom)
  22. _EQUAL(const-char*,const-gchar*)
  23. _EQUAL(return-char*,return-gchar*)
  24. _EQUAL(gpointer,void*)
  25. _EQUAL(gconstpointer,const void*)
  26.  
  27. #
  28. # Basic Types
  29. _CONVERSION(`int',`bool',`$3')
  30. _CONVERSION(`bool',`int',`static_cast<int>($3)')
  31. _CONVERSION(`unsigned int',`bool',`$3')
  32. _CONVERSION(`bool',`unsigned int',`static_cast<unsigned int>($3)')
  33. _CONVERSION(`int&',`gint*',`&($3)')
  34. _CONVERSION(`gint*',`int&',`*($3)')
  35. _CONVERSION(`guint&',`guint*',`&($3)')
  36. _CONVERSION(`double&',`gdouble*',`&($3)')
  37. _CONVERSION(`float&',`gfloat*',`&($3)')
  38. _CONVERSION(`gchar**',`char**',`$3')
  39. _CONVERSION(`char**',`gchar**',`$3')
  40. _CONVERSION(`gpointer&',`gpointer*',`&($3)')
  41. _CONVERSION(`void*&',`gpointer*',`&($3)')
  42.  
  43. _CONVERSION(`GError*&',`GError**',`&($3)')
  44.  
  45. _CONVERSION(`ui_merge_id',`guint',`$3')
  46. _CONVERSION(`guint',`ui_merge_id',`$3')
  47.  
  48. # Enums: TODO: It would be nice if gmmproc knew about these automatically.
  49. _CONV_ENUM(Gtk,AccelFlags)
  50. _CONV_ENUM(Gtk,ArrowType)
  51. _CONV_ENUM(Gtk,AttachOptions)
  52. _CONV_ENUM(Gtk,ButtonBoxStyle)
  53. _CONV_ENUM(Gtk,ButtonsType)
  54. _CONV_ENUM(Gtk,CalendarDisplayOptions)
  55. _CONV_ENUM(Gtk,CellRendererMode)
  56. _CONV_ENUM(Gtk,CellRendererState)
  57. _CONV_ENUM(Gtk,CornerType)
  58. _CONV_ENUM(Gtk,CurveType)
  59. _CONV_ENUM(Gtk,DeleteType)
  60. _CONV_ENUM(Gtk,DestDefaults)
  61. _CONV_ENUM(Gtk,DirectionType)
  62. _CONV_ENUM(Gtk,ExpanderStyle)
  63. _CONV_ENUM(Gtk,ImageType)
  64. _CONV_ENUM(Gtk,Justification)
  65. _CONV_ENUM(Gtk,MenuDirectionType)
  66. _CONV_ENUM(Gtk,MessageType)
  67. _CONV_ENUM(Gtk,MetricType)
  68. _CONV_ENUM(Gtk,MovementStep)
  69. _CONV_ENUM(Gtk,NotebookTab)
  70. _CONV_ENUM(Gtk,Orientation)
  71. _CONV_ENUM(Gtk,PackType)
  72. _CONV_ENUM(Gtk,PolicyType)
  73. _CONV_ENUM(Gtk,PositionType)
  74. _CONV_ENUM(Gtk,PreviewType)
  75. _CONV_ENUM(Gtk,ProgressBarOrientation)
  76. _CONV_ENUM(Gtk,ProgressBarStyle)
  77. _CONV_ENUM(Gtk,ReliefStyle)
  78. _CONV_ENUM(Gtk,ResizeMode)
  79. _CONV_ENUM(Gtk,ScrollType)
  80. _CONV_ENUM(Gtk,SelectionMode)
  81. _CONV_ENUM(Gtk,ShadowType)
  82. _CONV_ENUM(Gtk,SizeGroupMode)
  83. _CONV_ENUM(Gtk,SortType)
  84. _CONV_ENUM(Gtk,SpinButtonUpdatePolicy)
  85. _CONV_ENUM(Gtk,SpinType)
  86. _CONV_ENUM(Gtk,StateType)
  87. _CONV_ENUM(Gtk,TargetFlags)
  88. _CONV_ENUM(Gtk,TextDirection)
  89. _CONV_ENUM(Gtk,TextSearchFlags)
  90. _CONV_ENUM(Gtk,TextWindowType)
  91. _CONV_ENUM(Gtk,ToolbarChildType)
  92. _CONV_ENUM(Gtk,ToolbarStyle)
  93. _CONV_ENUM(Gtk,TreeModelFlags)
  94. _CONV_ENUM(Gtk,TreeViewColumnSizing)
  95. _CONV_ENUM(Gtk,TreeViewDropPosition)
  96. _CONV_ENUM(Gtk,UpdateType)
  97. _CONV_ENUM(Gtk,Visibility)
  98. _CONV_ENUM(Gtk,WidgetHelpType)
  99. _CONV_ENUM(Gtk,WindowPosition)
  100. _CONV_ENUM(Gtk,WindowType)
  101. _CONV_ENUM(Gtk,WrapMode)
  102. _CONV_ENUM(Gtk,UIManagerItemType)
  103. _CONV_ENUM(Gtk,FileChooserAction)
  104. _CONV_ENUM(Gtk,FileFilterFlags)
  105. _CONV_ENUM(Gtk,IconLookupFlags)
  106. _CONV_ENUM(Gtk,IconThemeError)
  107. _CONV_ENUM(Gtk,FileChooserConfirmation)
  108.  
  109. _CONVERSION(`GtkIconSize',`IconSize',`IconSize(static_cast<int>($3))')
  110. _CONVERSION(`GtkIconSize',`Gtk::IconSize',`Gtk::IconSize(static_cast<int>($3))')
  111. _CONVERSION(`IconSize',`GtkIconSize',`static_cast<GtkIconSize>(int($3))')
  112. _CONVERSION(`Gtk::IconSize',`GtkIconSize',`static_cast<GtkIconSize>(int($3))')
  113. include(convert_atk.m4)
  114. include(convert_pango.m4)
  115. include(convert_gdk.m4)
  116.  
  117. _CONVERSION(`guint',`WindowType',`static_cast<WindowType>($3)')
  118. _CONVERSION(`PolicyType&',`GtkPolicyType*',`(($2) &($3))')
  119. _CONVERSION(`SortType&',`GtkSortType*',`(($2) &($3))')
  120. _CONVERSION(`SortType*',`GtkSortType*',`(($2) ($3))')
  121. _CONVERSION(`GtkSortType*',`SortType*',`(($2) ($3))')
  122. _CONVERSION(`guint8',`Gtk::StateType',`static_cast<StateType>($3)')
  123.  
  124.  
  125.  
  126. # StockID:
  127. _CONVERSION(`const StockID&',`const char*',`($3).get_c_str()')
  128. _CONVERSION(`const Gtk::StockID&',`const char*',`($3).get_c_str()')
  129. _CONVERSION(`char*',`StockID',`StockID($3)') # the StockID ctor handles 0
  130.  
  131. #
  132. # Ptr (gtk+) -> Ptr (gtkmm)
  133. define(`__FP2P',`($`'2)Glib::unwrap($`'3)')
  134. define(`__RP2P',`Glib::wrap($`'3)')
  135. define(`__RP2PD',`Glib::wrap((tran`'slit($`'2,:,))($`'3))')
  136. define(`__RP2CPD',`Glib::wrap((tran`'slit(pat`'subst($`'2,^const ,),:,))($`'3))')
  137.  
  138. _CONVERSION(`GtkAdjustment*',`Gtk::Adjustment*',__RP2P)
  139. _CONVERSION(`GtkAdjustment*',`Adjustment*',__RP2P)
  140. _CONVERSION(`GtkWidget*',`Gtk::Widget*',__RP2P)
  141. _CONVERSION(`GtkWidget*',`Widget*',__RP2P)
  142. _CONVERSION(`GtkWindow*',`Window*',__RP2P)
  143. _CONVERSION(`GtkMenu*',`Menu*',__RP2P)
  144. _CONVERSION(`GtkToolItem*',`ToolItem*',__RP2P)
  145.  
  146. # Ptr (gtk+) -> const Ptr (gtkmm)
  147. _CONVERSION(`GtkAdjustment*',`const Gtk::Adjustment*',__RP2P)
  148. _CONVERSION(`GtkAdjustment*',`const Adjustment*',__RP2P)
  149. _CONVERSION(`GtkWidget*',`const Gtk::Widget*',__RP2P)
  150. _CONVERSION(`GtkWidget*',`const Widget*',__RP2P)
  151. _CONVERSION(`GtkWindow*',`const Window*',__RP2P)
  152. _CONVERSION(`GtkToolItem*',`const ToolItem*',__RP2P)
  153.  
  154. # Style:
  155. _CONVERSION(`GtkStyle*',`Glib::RefPtr<Style>',`Glib::wrap($3)')
  156. _CONVERSION(`GtkStyle*',`Glib::RefPtr<const Style>',`Glib::wrap($3)')
  157. _CONVERSION(`const Glib::RefPtr<Style>&',`GtkStyle*',__CONVERT_REFPTR_TO_P)
  158. _CONVERSION(`Glib::RefPtr<Style>',`GtkStyle*',__CONVERT_REFPTR_TO_P)
  159. _CONVERSION(`GtkRcStyle*',`Glib::RefPtr<RcStyle>',`Glib::wrap($3)')
  160. _CONVERSION(`GtkRcStyle*',`Glib::RefPtr<const RcStyle>',`Glib::wrap($3)')
  161. _CONVERSION(`const Glib::RefPtr<RcStyle>&',`GtkRcStyle*',__CONVERT_REFPTR_TO_P)
  162. _CONVERSION(`Glib::RefPtr<RcStyle>',`GtkRcStyle*',__CONVERT_REFPTR_TO_P)
  163. _CONVERSION(`GtkRcStyle*',`const Glib::RefPtr<RcStyle>&',`Glib::wrap($3)')
  164.  
  165. # AccelGroup:
  166. _CONVERSION(`GtkAccelGroup*',`Glib::RefPtr<AccelGroup>',`Glib::wrap($3)')
  167. _CONVERSION(`GtkAccelGroup*',`Glib::RefPtr<const AccelGroup>',`Glib::wrap($3)')
  168. _CONVERSION(`const Glib::RefPtr<AccelGroup>&',`GtkAccelGroup*',__CONVERT_REFPTR_TO_P)
  169. _CONVERSION(`Gtk::Object&',`GObject*', `($3).Glib::Object::gobj()')
  170.  
  171. #
  172. # Ptr (Gtkmm) -> Ptr (gtk+)
  173. _CONVERSION(`Gtk::Adjustment*',`GtkAdjustment*',__FP2P)
  174. _CONVERSION(`Adjustment*',`GtkAdjustment*',__FP2P)
  175. _CONVERSION(`Gtk::Widget*',`GtkWidget*',__FP2P)
  176. _CONVERSION(`Widget*',`GtkWidget*',__FP2P)
  177. _CONVERSION(`Menu*',`GtkMenu*',__FP2P)
  178.  
  179. #
  180. # Ptr (gtk+) -> Ptr (gtkmm) (downcast)
  181. _CONVERSION(`GtkWidget*',`Button*',`Glib::wrap((GtkButton*)($3))')
  182. _CONVERSION(`GtkWidget*',`Box*',`Glib::wrap((GtkBox*)($3))')
  183. _CONVERSION(`GtkWidget*',`HBox*',`Glib::wrap((GtkHBox*)($3))')
  184. _CONVERSION(`GtkWidget*',`VBox*',`Glib::wrap((GtkVBox*)($3))')
  185. _CONVERSION(`GtkWidget*',`ColorSelection*',`Glib::wrap((GtkColorSelection*)($3))')
  186. _CONVERSION(`GtkWidget*',`Gtk::CheckButton*',__RP2PD)
  187. _CONVERSION(`GtkWidget*',`Container*',`Glib::wrap((GtkContainer*)($3))')
  188. _CONVERSION(`GtkWidget*',`const Container*',`Glib::wrap((GtkContainer*)($3))')
  189. _CONVERSION(`GtkWidget*',`Entry*',`Glib::wrap((GtkEntry*)($3))')
  190. _CONVERSION(`GtkWidget*',`FontSelection*',`Glib::wrap((GtkFontSelection*)($3))')
  191. _CONVERSION(`GtkWidget*',`Label*',`Glib::wrap((GtkLabel*)($3))')
  192. _CONVERSION(`GtkWidget*',`Menu*',`Glib::wrap((GtkMenu*)($3))')
  193. _CONVERSION(`GtkWidget*',`MenuItem*',`Glib::wrap((GtkMenuItem*)($3))')
  194. _CONVERSION(`GtkWidget*',`OptionMenu*',`Glib::wrap((GtkOptionMenu*)($3))')
  195. _CONVERSION(`GtkWidget*',`RadioButton*',`Glib::wrap((GtkRadioButton*)($3))')
  196. _CONVERSION(`GtkWidget*',`Gtk::Scrollbar*',__RP2PD)
  197. _CONVERSION(`GtkWidget*',`Gtk::HScrollbar*',__RP2PD)
  198. _CONVERSION(`GtkWidget*',`Gtk::VScrollbar*',__RP2PD)
  199. _CONVERSION(`GtkWidget*',`Table*',`Glib::wrap((GtkTable*)($3))')
  200. _CONVERSION(`GtkWidget*',`Gtk::Tree*',__RP2PD)
  201. _CONVERSION(`GtkWidget*',`ScrolledWindow*',`Glib::wrap((GtkScrolledWindow*)($3))')
  202. _CONVERSION(`GtkWidget*',`Window*',`Glib::wrap((GtkWindow*)($3))')
  203. _CONVERSION(`GtkWidget*',`TreeView*',`Glib::wrap((GtkTreeView*)($3))')
  204. _CONVERSION(`GtkWidget*',`HButtonBox*',`Glib::wrap((GtkHButtonBox*)($3))')
  205. _CONVERSION(`GtkWidget*',`ComboDropDown*',`Glib::wrap((GtkList*)($3))')
  206. _CONVERSION(`GtkWidget*',`Image*',`Glib::wrap((GtkImage*)($3))')
  207. _CONVERSION(`GtkWidget*',`ToolItem*',`Glib::wrap((GtkToolItem*)($3))')
  208. _CONVERSION(`GtkWidget*',`FileChooserDialog*',`Glib::wrap((GtkFileChooserDialog*)($3))')
  209.  
  210. # Ptr (gtk+) -> const Ptr (gtkmm) (downcast)
  211. _CONVERSION(`GtkWidget*',`const Button*',`Glib::wrap((GtkButton*)($3))')
  212. _CONVERSION(`GtkWidget*',`const Box*',`Glib::wrap((GtkBox*)($3))')
  213. _CONVERSION(`GtkWidget*',`const HBox*',`Glib::wrap((GtkHBox*)($3))')
  214. _CONVERSION(`GtkWidget*',`const VBox*',`Glib::wrap((GtkVBox*)($3))')
  215. _CONVERSION(`GtkWidget*',`const ColorSelection*',`Glib::wrap((GtkColorSelection*)($3))')
  216. _CONVERSION(`GtkWidget*',`const Gtk::CheckButton*',__RP2CPD)
  217. _CONVERSION(`GtkWidget*',`const Entry*',`Glib::wrap((GtkEntry*)($3))')
  218. _CONVERSION(`GtkWidget*',`const FontSelection*',`Glib::wrap((GtkFontSelection*)($3))')
  219. _CONVERSION(`GtkWidget*',`const Label*',`Glib::wrap((GtkLabel*)($3))')
  220. _CONVERSION(`GtkWidget*',`const Menu*',`Glib::wrap((GtkMenu*)($3))')
  221. _CONVERSION(`GtkWidget*',`const MenuItem*',`Glib::wrap((GtkMenuItem*)($3))')
  222. _CONVERSION(`GtkWidget*',`const OptionMenu*',`Glib::wrap((GtkOptionMenu*)($3))')
  223. _CONVERSION(`GtkWidget*',`const RadioButton*',`Glib::wrap((GtkRadioButton*)($3))')
  224. _CONVERSION(`GtkWidget*',`const Gtk::Scrollbar*',__RP2CPD)
  225. _CONVERSION(`GtkWidget*',`const Gtk::HScrollbar*',__RP2CPD)
  226. _CONVERSION(`GtkWidget*',`const Gtk::VScrollbar*',__RP2CPD)
  227. _CONVERSION(`GtkWidget*',`const Table*',`Glib::wrap((GtkTable*)($3))')
  228. _CONVERSION(`GtkWidget*',`const Gtk::Tree*',__RP2CPD)
  229. _CONVERSION(`GtkWidget*',`const ScrolledWindow*',`Glib::wrap((GtkScrolledWindow*)($3))')
  230. _CONVERSION(`GtkWidget*',`const Window*',`Glib::wrap((GtkWindow*)($3))')
  231. _CONVERSION(`GtkWidget*',`const TreeView*',`Glib::wrap((GtkTreeView*)($3))')
  232. _CONVERSION(`GtkWidget*',`const HButtonBox*',`Glib::wrap((GtkHButtonBox*)($3))')
  233. _CONVERSION(`GtkWidget*',`const ComboDropDown*',`Glib::wrap((GtkList*)($3))')
  234. _CONVERSION(`GtkWidget*',`const FileChooserDialog*',`Glib::wrap((GtkFileChooserDialog*)($3))')
  235.  
  236. # Ptr (gtk+) -> Ref (Gtkmm)
  237. _CONVERSION(`GtkWidget*', `Widget&', `*Glib::wrap($3)')
  238.  
  239. # Ref (Gtkmm) -> GtkWidget* Ptr (gtk+)
  240. define(`__FR2PD',`($`'3).Gtk::Widget::gobj()')
  241. _CONVERSION(`MenuShell&',`GtkWidget*',__FR2PD)
  242. _CONVERSION(`MenuItem&',`GtkWidget*',__FR2PD)
  243. _CONVERSION(`Menu&',`GtkWidget*',__FR2PD)
  244. _CONVERSION(`Gtk::TreeItem&',`GtkWidget*',__FR2PD)
  245. _CONVERSION(`FileChooserDialog&',`GtkWidget*',__FR2PD)
  246.  
  247. # Ref (Gtkmm) -> Ptr (gtk+)
  248. define(`__FR2P',`($`'3).gobj()')
  249. define(`__FCR2P',`const_cast<$`'2>(($`'3).gobj())')
  250. _CONVERSION(`Gtk::Adjustment&',`GtkAdjustment*',__FR2P)
  251. _CONVERSION(`Adjustment&',`GtkAdjustment*',__FR2P)
  252. _CONVERSION(`Gtk::Style&',`GtkStyle*',__FR2P)
  253. _CONVERSION(`Gtk::Widget&',`GtkWidget*',__FR2P)
  254. _CONVERSION(`Widget&',`GtkWidget*',__FR2P)
  255. _CONVERSION(`Window&',`GtkWindow*',__FR2P)
  256. _CONVERSION(`CellRenderer&',`GtkCellRenderer*',__FR2P)
  257. _CONVERSION(`const CellRenderer&',`GtkCellRenderer*',__FCR2P)
  258. _CONVERSION(`ToolItem&',`GtkToolItem*',__FR2P)
  259. _CONVERSION(`const ToolItem&',`GtkToolItem*',__FCR2P)
  260.  
  261. # Glib::ListHandle<> (gtkmm) -> GList (gtk+)
  262. _CONVERSION(`const Glib::ListHandle<Glib::ustring>&',`GList*',`$3.data()')
  263. _CONVERSION(`const Glib::ListHandle<Widget*>&',`GList*',`$3.data()')
  264. _CONVERSION(`const Glib::ListHandle<const Widget*>&',`GList*',`$3.data()')
  265. _CONVERSION(`const Glib::ListHandle<Window*>&',`GList*',`$3.data()')
  266. _CONVERSION(`const Glib::ListHandle<const Window*>&',`GList*',`$3.data()')
  267. _CONVERSION(`const Glib::SListHandle< Glib::RefPtr<RadioAction> >&',`GSList*',`$3.data()')
  268. _CONVERSION(`const Glib::SListHandle< Glib::RefPtr<const RadioAction> >&',`GSList*',`$3.data()')
  269.  
  270. # GList (gtk+) -> Glib::ListHandle<> (gtkmm)
  271. define(`__FL2H_DEEP',`$`'2($`'3, Glib::OWNERSHIP_DEEP)')
  272. define(`__FL2H_SHALLOW',`$`'2($`'3, Glib::OWNERSHIP_SHALLOW)')
  273. define(`__FL2H_NONE',`$`'2($`'3, Glib::OWNERSHIP_NONE)')
  274.  
  275. _CONVERSION(`GList*',`Glib::ListHandle<Widget*>',__FL2H_SHALLOW)
  276. _CONVERSION(`GList*',`Glib::ListHandle<const Widget*>',__FL2H_SHALLOW)
  277. _CONVERSION(`GSList*',`Glib::SListHandle<Widget*>',__FL2H_SHALLOW)
  278. _CONVERSION(`GSList*',`Glib::SListHandle<const Widget*>',__FL2H_SHALLOW)
  279. _CONVERSION(`GList*',`Glib::ListHandle<Window*>',__FL2H_SHALLOW)
  280. _CONVERSION(`GList*',`Glib::ListHandle<TreeViewColumn*>',__FL2H_SHALLOW)
  281. _CONVERSION(`GList*',`Glib::ListHandle<const TreeViewColumn*>',__FL2H_SHALLOW)
  282. _CONVERSION(`GList*',`Glib::ListHandle<CellRenderer*>',__FL2H_SHALLOW)
  283. _CONVERSION(`GList*',`Glib::ListHandle<const CellRenderer*>',__FL2H_SHALLOW)
  284. _CONVERSION(`GList*',`Glib::ListHandle<TreeModel::Row>',__FL2H_SHALLOW)
  285. _CONVERSION(`GList*',`Glib::ListHandle<const TreeModel::Row>',__FL2H_SHALLOW)
  286. _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Action> >',__FL2H_SHALLOW)
  287. _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<const Action> >',__FL2H_SHALLOW)
  288. _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<ActionGroup> >',__FL2H_SHALLOW)
  289. _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<const ActionGroup> >',__FL2H_SHALLOW)
  290. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<Tag> >',__FL2H_SHALLOW)
  291. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<const Tag> >',__FL2H_SHALLOW)
  292. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<TextTag> >',__FL2H_SHALLOW)
  293. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<const TextTag> >',__FL2H_SHALLOW)
  294. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<TextMark> >',__FL2H_SHALLOW)
  295. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<const TextMark> >',__FL2H_SHALLOW)
  296. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<TextBuffer::Mark> >',__FL2H_SHALLOW)
  297. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<const TextBuffer::Mark> >',__FL2H_SHALLOW)
  298. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<RadioAction> >',__FL2H_SHALLOW)
  299. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<const RadioAction> >',__FL2H_SHALLOW)
  300.  
  301. _CONVERSION(`GSList*',`Glib::SListHandle< FileFilter* >',__FL2H_SHALLOW)
  302. _CONVERSION(`GSList*',`Glib::SListHandle< const FileFilter* >',__FL2H_SHALLOW)
  303. _CONVERSION(`GSList*',`Glib::SListHandle<Glib::ustring>',__FL2H_DEEP)
  304. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<PixbufFormat> >',__FL2H_SHALLOW)
  305. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<const PixbufFormat> >',__FL2H_SHALLOW)
  306. _CONVERSION(`GSList*',`SListHandle_PixbufFormat',__FL2H_DEEP)
  307.  
  308. _CONVERSION(`const Widget&',`GtkWidget*',__FCR2P)
  309.  
  310. _CONVERSION(`int&',`int*',`&$3',`*$3')
  311.  
  312. dnl
  313. dnl # TODO: These are for fixmegtkconst
  314. _CONVERSION(`gdouble*',`const gdouble*',`const_cast<const gdouble*>($3)',`$3')
  315. _CONVERSION(`const double*',`gdouble*',`const_cast<gdouble*>($3)',`$3')
  316. _CONVERSION(`const guchar*',`guchar*',`const_cast<guchar*>($3)',`$3')
  317.  
  318. #_CONVERSION(`GSList*',`const Group&',`Group($3)')
  319. _CONVERSION(`GSList*',`Group',`Group($3)')
  320. _CONVERSION(`Group&',`GSList*',`$3.group_')
  321. _CONVERSION(`Group',`GSList*',`$3.group_')
  322.  
  323. _CONVERSION(`Gtk::Item&',`GtkItem*',__FR2P)
  324. _CONVERSION(Gtk::Notebook_Helpers::Page*,GtkNotebookPage*,`($1)((void*)($3))',`($2)((void*)($3))')
  325.  
  326. _CONVERSION(`GtkSettings*',`Glib::RefPtr<Settings>', Glib::wrap($3))
  327.  
  328. _CONVERSION(`IconSet&',`GtkIconSet*',__FR2P)
  329. _CONVERSION(`const IconSet&',`GtkIconSet*',`const_cast<GtkIconSet*>(($3).gobj())')
  330. _CONVERSION(`GtkIconSet*',`IconSet',`Glib::wrap($3)')
  331. _CONVERSION(`IconSource&',`GtkIconSource*',__FR2P)
  332. _CONVERSION(`const IconSource&',`const GtkIconSource*',__FR2P)
  333. _CONVERSION(`const GtkIconSource*',`const IconSource&',`Glib::wrap(const_cast<GtkIconSource*>($3), true)')
  334.  
  335. _CONVERSION(`GtkIconTheme*',`Glib::RefPtr<IconTheme>',`Glib::wrap($3)')
  336. _CONVERSION(`GList*',`Glib::ListHandle<Glib::ustring>',__FL2H_SHALLOW)
  337.  
  338. # gpointer conversions:
  339. # There's doesn't seem to be a way to tell g_signal_new that it's a pointer to a gint, for instance:
  340. #_CONVERSION(`int*',`gpointer',`($1)$3')
  341. #_CONVERSION(`gpointer',`int*',`($1)$3')
  342.  
  343.  
  344. # Text:
  345. _CONVERSION(`GtkTextTagTable*',`Glib::RefPtr<TextTagTable>',`Glib::wrap($3)')
  346. _CONVERSION(`GtkTextTagTable*',`Glib::RefPtr<TagTable>',`Glib::wrap($3)')
  347. _CONVERSION(`GtkTextTagTable*',`Glib::RefPtr<TextBuffer::TagTable>',`Glib::wrap($3)')
  348. _CONVERSION(`GtkTextTagTable*',`Glib::RefPtr<const TextBuffer::TagTable>',`Glib::wrap($3)')
  349. _CONVERSION(`GtkTextMark*',`Glib::RefPtr<Mark>',`Glib::wrap($3)')
  350. _CONVERSION(`GtkTextMark*',`Glib::RefPtr<TextBuffer::Mark>',`Glib::wrap($3)')
  351. _CONVERSION(`GtkTextMark*',`Glib::RefPtr<const TextBuffer::Mark>',`Glib::wrap($3)')
  352. _CONVERSION(`const Glib::RefPtr<Mark>&',`GtkTextMark*',__CONVERT_REFPTR_TO_P)
  353. _CONVERSION(`const Glib::RefPtr<TextBuffer::Mark>&',`GtkTextMark*',__CONVERT_REFPTR_TO_P)
  354. _CONVERSION(`GtkTextTag*',`Glib::RefPtr<TextTag>',`Glib::wrap($3)')
  355. _CONVERSION(`GtkTextTag*',`Glib::RefPtr<const TextTag>',`Glib::wrap($3)')
  356. _CONVERSION(`const Glib::RefPtr<TextTag>&',`GtkTextTag*',__CONVERT_REFPTR_TO_P)
  357. _CONVERSION(`const Glib::RefPtr<const TextTag>&',`GtkTextTag*',__CONVERT_CONST_REFPTR_TO_P_SUN(TextTag))
  358. _CONVERSION(`const Glib::RefPtr<Tag>&',`GtkTextTag*',__CONVERT_REFPTR_TO_P)
  359. _CONVERSION(`const Glib::RefPtr<TextBuffer::Tag>&',`GtkTextTag*',__CONVERT_REFPTR_TO_P)
  360. _CONVERSION(`GtkTextBuffer*',`Glib::RefPtr<TextBuffer>',`Glib::wrap($3)')
  361. _CONVERSION(`GtkTextBuffer*',`Glib::RefPtr<const TextBuffer>',`Glib::wrap($3)')
  362. _CONVERSION(`TextIter&',`GtkTextIter*',__FR2P)
  363. _CONVERSION(`TextBuffer::iterator&',`GtkTextIter*',__FR2P)
  364. _CONVERSION(`iterator&',`GtkTextIter*',__FR2P)
  365. _CONVERSION(`const TextIter&',`const GtkTextIter*',__FR2P)
  366. _CONVERSION(`const TextBuffer::iterator&',`const GtkTextIter*',__FR2P)
  367. _CONVERSION(`const iterator&',`const GtkTextIter*',__FR2P)
  368. _CONVERSION(`TextAttributes&',`GtkTextAttributes*',__FR2P)
  369. _CONVERSION(`GtkTextAttributes*',`TextAttributes',TextAttributes($3))
  370. _CONVERSION(`const Glib::RefPtr<TextTagTable>&',`GtkTextTagTable*',__CONVERT_REFPTR_TO_P)
  371. _CONVERSION(`const Glib::RefPtr<TextBuffer>&',`GtkTextBuffer*',__CONVERT_REFPTR_TO_P)
  372. _CONVERSION(`const Glib::RefPtr<TextChildAnchor>&',`GtkTextChildAnchor*',__CONVERT_REFPTR_TO_P)
  373. _CONVERSION(`const Glib::RefPtr<ChildAnchor>&',`GtkTextChildAnchor*',__CONVERT_REFPTR_TO_P)
  374. _CONVERSION(`const Glib::RefPtr<TextBuffer::ChildAnchor>&',`GtkTextChildAnchor*',__CONVERT_REFPTR_TO_P)
  375. _CONVERSION(`GtkTextChildAnchor*',`Glib::RefPtr<ChildAnchor>',`Glib::wrap($3)')
  376. _CONVERSION(`GtkTextChildAnchor*',`Glib::RefPtr<TextChildAnchor>',`Glib::wrap($3)')
  377. _CONVERSION(`GtkTextChildAnchor*',`Glib::RefPtr<const TextChildAnchor>',`Glib::wrap($3)')
  378.  
  379. # Tree:
  380. #_CONVERSION(`const TreeIter&',`const GtkTreeIter*',__FR2P)
  381. _CONVERSION(`const iterator&',`const GtkTreeIter*',__FR2P)
  382. #_CONVERSION(`const TreeIter&',`GtkTreeIter*',__FCR2P)
  383. _CONVERSION(`const iterator&',`GtkTreeIter*',__FCR2P)
  384. _CONVERSION(`const TreeModel::Row&',`GtkTreeIter*',__FCR2P)
  385. _CONVERSION(`iterator&',`GtkTreeIter*',__FR2P)
  386. _CONVERSION(`const TreeModel::iterator&',`GtkTreeIter*',__FCR2P)
  387. _CONVERSION(`const iterator&',`GtkTreeIter*',__FCR2P)
  388. _CONVERSION(`TreeViewColumn&',`GtkTreeViewColumn*',__FR2P)
  389. _CONVERSION(`GtkTreeViewColumn*',`TreeViewColumn*',`Glib::wrap($3)')
  390. _CONVERSION(`GtkTreeViewColumn*',`const TreeViewColumn*',`Glib::wrap($3)')
  391. _CONVERSION(`TreePath&',`GtkTreePath*',__FR2P)
  392. _CONVERSION(`const TreePath&',`const GtkTreePath*',__FR2P)
  393. _CONVERSION(`const TreePath&',`GtkTreePath*',__FCR2P)
  394. _CONVERSION(`const Path&',`GtkTreePath*',__FCR2P)
  395. _CONVERSION(`const TreeModel::Path&',`GtkTreePath*',__FCR2P)
  396. _CONVERSION(`GtkTreeView*',`TreeView*',`Glib::wrap($3)')
  397. _CONVERSION(`GtkTreeView*',`const TreeView*',`Glib::wrap($3)')
  398. _CONVERSION(`GtkTreeModel*',`Glib::RefPtr<TreeModel>',`Glib::wrap($3)')
  399. _CONVERSION(`GtkTreeModel*',`Glib::RefPtr<const TreeModel>',`Glib::wrap($3)')
  400. _CONVERSION(`const Glib::RefPtr<TreeModel>&',`GtkTreeModel*',__CONVERT_REFPTR_TO_P)
  401. _CONVERSION(`GtkTreeSelection*',`Glib::RefPtr<TreeSelection>',`Glib::wrap($3)')
  402. _CONVERSION(`GtkTreeSelection*',`Glib::RefPtr<const TreeSelection>',`Glib::wrap($3)')
  403. _CONVERSION(`const TreeModelColumnBase&',`int',`($3).index`'()')
  404. _CONVERSION(`GtkTreePath*',`TreePath', `Gtk::TreePath($3, false)')
  405. _CONVERSION(`GtkTreePath*',`Path', `Gtk::TreePath($3, false)')
  406. _CONVERSION(`GtkTreePath*',`TreeModel::Path', `Gtk::TreePath($3, false)')
  407. _CONVERSION(`GtkIconSet*&',`GtkIconSet**',`&($3)')
  408. _CONVERSION(`GtkIconSize&',`GtkIconSize*',`&($3)')
  409. _CONVERSION(`GtkCellEditable*',`CellEditable*',`dynamic_cast<$2>(Glib::wrap_auto((GObject*)($3), false))')
  410. _CONVERSION(`CellEditable*',`GtkCellEditable*',`Glib::unwrap($3)')
  411.  
  412.  
  413. #_CONVERSION(`Clipboard&',`GtkClipboard*',`($3).gobj()')
  414. _CONVERSION(`GtkClipboard*',`Glib::RefPtr<Clipboard>',`Glib::wrap($3)')
  415. _CONVERSION(`GtkClipboard*',`Glib::RefPtr<const Clipboard>',`Glib::wrap($3)')
  416. _CONVERSION(`const Glib::RefPtr<Clipboard>&',`GtkClipboard*',__CONVERT_REFPTR_TO_P($3))
  417. #_CONVERSION(`GtkClipboard*',`Gtk::Clipboard&',`Glib::wrap($3, true)')
  418.  
  419. _CONVERSION(`SelectionData',`GtkSelectionData*', `($3).gobj()')
  420. _CONVERSION(`const SelectionData&',`GtkSelectionData*', __FCR2P)
  421. _CONVERSION(`SelectionData&',`GtkSelectionData*', __FR2P)
  422. #_CONVERSION(`GtkSelectionData*',`SelectionData', `Gtk::SelectionData(($3), true)')
  423.  
  424. _CONVERSION(`GtkAction*',`Glib::RefPtr<Action>',`Glib::wrap($3)')
  425. _CONVERSION(`GtkAction*',`Glib::RefPtr<const Action>',`Glib::wrap($3)')
  426. _CONVERSION(`const Glib::RefPtr<Action>&',`GtkAction*',__CONVERT_REFPTR_TO_P($3))
  427. _CONVERSION(`GtkRadioAction*',`const Glib::RefPtr<RadioAction>&',`Glib::wrap($3)')
  428. _CONVERSION(`const Glib::RefPtr<RadioAction>&',`GtkRadioAction*',__CONVERT_REFPTR_TO_P($3))
  429.  
  430. _CONVERSION(`GtkActionGroup*',`Glib::RefPtr<ActionGroup>',`Glib::wrap($3)')
  431. #_CONVERSION(`GtkActionGroup*',`Glib::RefPtr<const ActionGroup>',`Glib::wrap($3)')
  432. _CONVERSION(`const Glib::RefPtr<ActionGroup>&',`GtkActionGroup*',__CONVERT_REFPTR_TO_P($3))
  433.  
  434. _CONVERSION(`GtkEntryCompletion*',`Glib::RefPtr<EntryCompletion>',`Glib::wrap($3)')
  435. _CONVERSION(`GtkEntryCompletion*',`Glib::RefPtr<const EntryCompletion>',`Glib::wrap($3)')
  436. _CONVERSION(`const Glib::RefPtr<EntryCompletion>&',`GtkEntryCompletion*',__CONVERT_REFPTR_TO_P($3))
  437.  
  438. _CONVERSION(`GtkFileFilter*',`FileFilter*',`Glib::wrap($3)')
  439. _CONVERSION(`GtkFileFilter*',`const FileFilter*',`Glib::wrap($3)')
  440. _CONVERSION(`const FileFilter&',`GtkFileFilter*',__FCR2P)
  441.  
  442. _CONVERSION(`GdkPixbufFormat*',`PixbufFormat',`PixbufFormat($3)')
  443.  
  444. _CONVERSION(const Gtk::Widget&,GtkWidget*,__CFR2P)
  445.  
  446. #_CONVERSION(`GtkTooltips*',`Tooltips&', `Glib::wrap($3)')
  447. _CONVERSION(`GtkTooltips*',`Tooltips*', `Glib::wrap($3)')
  448. _CONVERSION(`Tooltips*',`GtkTooltips*',`Glib::unwrap($3)')
  449. _CONVERSION(`Tooltips&',`GtkTooltips*',__FR2P)
  450.  
  451. _CONVERSION(`Allocation&',`GtkAllocation*',`($2)($3.gobj())')
  452. #_CONVERSION(`GtkAllocation*',`Allocation&',`($2)(Glib::wrap($3))')
  453.  
  454. #TargetList
  455. _CONVERSION(`const Glib::RefPtr<TargetList>&',`GtkTargetList*',__CONVERT_CONST_REFPTR_TO_P)
  456. _CONVERSION(`Glib::RefPtr<TargetList>&',`GtkTargetList*',__CONVERT_REFPTR_TO_P($3))
  457. _CONVERSION(`GtkTargetList*',`Glib::RefPtr<TargetList>',`Glib::wrap($3)')
  458. _CONVERSION(`GtkTargetList*',`Glib::RefPtr<const TargetList>',`Glib::wrap($3)')
  459.  
  460. #IconInfo
  461. _CONVERSION(`GtkIconInfo*',`IconInfo',`Glib::wrap($3)')
  462.  
  463. _CONVERSION(`Requisition&', `GtkRequisition*', `($2)(&$3)')
  464. _CONVERSION(`const Requisition&', `GtkRequisition*', `($2)(&$3)')
  465. _CONVERSION(`GtkRequisition*', `Requisition&', `($2)(*$3)')
  466. _CONVERSION(`GtkRequisition*', `Requisition*', `($2)($3)')
  467. _CONVERSION(`Requisition*', `GtkRequisition*', `($2)($3)')
  468. _CONVERSION(`GtkRequisition', `Requisition', `($2)($3)')
  469.  
  470. _CONVERSION(`Allocation&',`GtkAllocation*',`($2)($3.gobj())')
  471. _CONVERSION(`const Allocation&',`GtkAllocation*',`($2)($3.gobj())')
  472. _CONVERSION(`GtkAllocation',`Allocation',`($2)(Glib::wrap(&$3))')
  473. _CONVERSION(`GtkAllocation*',`Allocation&',`($2)(Glib::wrap($3))')
  474. _CONVERSION(`Allocation',`GtkAllocation',`($2)(*($3.gobj()))')
  475.  
  476.  
  477.  
  478. # Used by Signals:
  479. # The true here means "take reference", because the code that emits the signal does not do a ref for the receiving signal handler.
  480. # For the return values of methods, we use the optional refreturn parameter instead.
  481. _CONVERSION(`GtkTextIter*',`const TextIter&',Glib::wrap($3))
  482. _CONVERSION(`GtkTextIter*',`const TextBuffer::iterator&',Glib::wrap($3))
  483. _CONVERSION(`const GtkTextIter*',`const TextIter&',Glib::wrap($3))
  484. _CONVERSION(`const GtkTextIter*',`const TextBuffer::iterator&',Glib::wrap($3))
  485. _CONVERSION(`const TextIter&',`GtkTextIter*',__FCR2P)
  486. _CONVERSION(`const TextBuffer::iterator&',`GtkTextIter*',__FCR2P)
  487. _CONVERSION(`GtkTextChildAnchor*',`const Glib::RefPtr<ChildAnchor>&',`Glib::wrap($3, true)')
  488. _CONVERSION(`GtkTextMark*',`const Glib::RefPtr<Mark>&',`Glib::wrap($3, true)')
  489. _CONVERSION(`GtkTextMark*',`const Glib::RefPtr<TextBuffer::Mark>&',`Glib::wrap($3, true)')
  490. _CONVERSION(`GtkTextTag*',`const Glib::RefPtr<TextTag>&',`Glib::wrap($3, true)')
  491. _CONVERSION(`GtkTextTag*',`const Glib::RefPtr<TextBuffer::Tag>&',`Glib::wrap($3, true)')
  492. _CONVERSION(`GObject*',`const Glib::RefPtr<Glib::Object>&',`Glib::wrap($3, true)')
  493. _CONVERSION(`GtkTreePath*',`const TreeModel::Path&',`Gtk::TreePath($3, true)')
  494. _CONVERSION(`GtkTreePath*',`const Path&',`Gtk::TreePath($3, true)')
  495. _CONVERSION(`TreeViewColumn*',`GtkTreeViewColumn*',__FP2P)
  496. _CONVERSION(`GtkStyle*',`const Glib::RefPtr<Style>&',`Glib::wrap($3, true)')
  497. _CONVERSION(`GtkSelectionData*',`const SelectionData&', `SelectionData_WithoutOwnership($3)')
  498. _CONVERSION(`GtkSelectionData*',`SelectionData&', `SelectionData_WithoutOwnership($3)')
  499. _CONVERSION(`GtkTreeModel*',`const Glib::RefPtr<const TreeModel>&',`Glib::wrap($3, true)')
  500. _CONVERSION(`const Glib::RefPtr<const TreeModel>&',`GtkTreeModel*',__CONVERT_CONST_REFPTR_TO_P)
  501. #_CONVERSION(`GtkTreeIter*',`const TreeModel::iterator&',Glib::wrap($3, true))
  502. _CONVERSION(`GdkScreen*',`const Glib::RefPtr<Gdk::Screen>&',`Glib::wrap($3, true)')
  503. _CONVERSION(`CellRenderer*',`GtkCellRenderer*',__FP2P)
  504. _CONVERSION(`GtkCellRenderer*',`CellRenderer*',__RP2P)
  505. _CONVERSION(`GtkAction*',`const Glib::RefPtr<Action>&',`Glib::wrap($3, true)')
  506.  
  507. _CONVERSION(`AlignmentEnum',`float',`_gtkmm_align_float_from_enum($3)')
  508.  
  509. # Used by AboutDialog:
  510. #_CONVERSION(`const Glib::StringArrayHandle&',`const gchar**',`($3).data())')
  511. _CONVERSION(`const Glib::StringArrayHandle&',`const gchar**',`const_cast<const gchar**>(($3).data())')
  512.